import React from 'react';
import {Animated, Platform, StyleSheet, View,} from 'react-native';
import Layout from './Layout';

type PropTypes = {
  style:any,
  shadowStyle:any,
}

export default class TabBar extends React.Component<PropTypes, any> {
  render() {
    return (
      <Animated.View {...this.props} style={[styles.container, this.props.style]}>
        {this.props.children}
        <View style={[styles.shadow, this.props.shadowStyle]} />
      </Animated.View>
    );
  }
}

let styles = StyleSheet.create({
  container: {
    backgroundColor: '#FFFFFF',
    flexDirection: 'row',
    justifyContent: 'space-around',
    height: Layout.tabBarHeight,
    position: 'absolute',
    top: Platform.OS === 'web' ? (Layout.screen.height - Layout.tabBarHeight) : undefined,
    bottom:Platform.OS !== 'web' ? 0 : undefined,
    left: 0,
    right: 0,
  },
  shadow: {
    backgroundColor: 'rgba(0, 0, 0, 0.25)',
    height: Layout.pixel,
    position: 'absolute',
    left: 0,
    right: 0,
    top: Platform.OS === 'web' ? -Layout.pixel : undefined,
    bottom:Platform.OS !== 'web' ? 0 : undefined,
    // top: Platform.OS === 'macos' ? 0 : 0,
  },
});
